using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using TCEntity;
using Image = TCEntity.Image;

namespace TimeCameraWinForm
{
  public partial class PictureForm : Form
  {
    Image image;
    public PictureForm(Image pic)
    {
      InitializeComponent();
      this.image = pic;
      pictureBox_Detail.SizeMode = PictureBoxSizeMode.StretchImage;
      pictureBox_Detail.Image = System.Drawing.Image.FromStream(new MemoryStream(image.Picture));
    }

    private void btn_Download_Click(object sender, EventArgs e)
    {
      if (saveFileDialog1.ShowDialog(this) == DialogResult.OK)
      {
        saveFileDialog1.OpenFile().Write(image.Picture);
        MessageBox.Show("下载成功。");
      }
    }
  }
}
